﻿using System;
using System.ComponentModel;

namespace InfiniTec.Threading
{
	public class AsyncCompletedEventArgs<T>: AsyncCompletedEventArgs
	{
		private readonly T _Result;

		public T Result { get { return _Result; } }

		public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState) : base(error, cancelled, userState) {}

		public AsyncCompletedEventArgs(T result, object userState) : base(null, false, userState)
		{
			_Result = result;
		}

		public AsyncCompletedEventArgs(AsyncCompletedEventArgs e, T result) : base(e.Error, e.Cancelled, e.UserState)
		{
			_Result = result;
		}
	}
}